{% load static %}
<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <title>Repo</title>

    <!-- Bootstrap core CSS -->
    <link href="{% static 'repo/bootstrap/css/bootstrap.min.css' %}" rel="stylesheet">

    <style>
        .bd-placeholder-img {
            font-size: 1.125rem;
            text-anchor: middle;
            -webkit-user-select: none;
            -moz-user-select: none;
            user-select: none;
        }

        @media (min-width: 768px) {
            .bd-placeholder-img-lg {
                font-size: 3.5rem;
            }
        }

        select {
            cursor: url("{% static 'repo/Arrow.cur' %}"), pointer;
        }


        html {
            cursor: url("{% static 'repo/Arrow.cur' %}"), pointer;
        }

        a {
            cursor: url("{% static 'repo/hand.cur' %}"), cell;
        }

        .btn{
            cursor: url("{% static 'repo/hand.cur' %}"), cell !important;
        }

        input {
            cursor: url("{% static 'repo/Arrow.cur' %}"), pointer;
        }

    </style>

    {% block css %}
    {% endblock %}
    <!-- Custom styles for this template -->
    <link href="{% static 'repo/m/mcss/dashboard.css' %}" rel="stylesheet">
</head>
<body>

<header class="navbar navbar-dark sticky-top flex-md-nowrap p-0 shadow" style="background-color: #273c75">
    <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3 text-light fs-5 font-monospace fw-bold" href="#">QIANG</a>
    <button class="navbar-toggler position-absolute d-md-none"
            type="button" data-bs-toggle="collapse" data-bs-target="#sidebarMenu"
            aria-controls="sidebarMenu" aria-expanded="false"
            aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>
    <div class="w-75"></div>
    <div>
        <ul class="navbar-nav me-auto mb-2 mb-lg-0">
            <div class="row">
                {% if user.is_authenticated %}
                    <div class="col-6 nav-item text-nowrap">
                        <a class="nav-link px-3" href="#">用户: {{ user.get_username }}</a>
                    </div>
                    <div class="col-6 nav-item text-nowrap">
                        <a class="nav-link px-3" href="{% url 'logout' %}?next=/accounts/logout/">登出</a>
                    </div>
                {% else %}
                    <div class="col-6 nav-item text-nowrap">
                        <a class="nav-link px-3" href="{% url 'login' %}">登录</a>
                    </div>
                {% endif %}
            </div>
        </ul>
    </div>
</header>

<div class="container-fluid">
    <div class="row">
        <nav id="sidebarMenu" class="col-md-3 col-lg-2
    d-md-block bg-light sidebar collapse">
            <div class="position-sticky pt-3">
                <ul class="nav flex-column">
                    <li class="nav-item">
                        <a id="general" class="nav-link" href="{% url 'repo:index' %}">
                            <span data-feather="bar-chart"></span>
                            概览
                        </a>
                    </li>
                    <li id="statistic" class="nav-item">
                        <a class="nav-link" href="#">
                            <span data-feather="trending-up"></span>
                            统计
                        </a>
                    </li>
                    <li class="nav-item">
                        <a id="purchase" class="nav-link" href="{% url 'repo:purchase' %}">
                            <span data-feather="shopping-cart"></span>
                            采购
                        </a>
                    </li>
                    <li class="nav-item">
                        <a id="produce" class="nav-link" href="{% url 'repo:produce' %}">
                            <span data-feather="archive"></span>
                            生产
                        </a>
                    </li>

                    <hr class="w-75 align-self-center"/>
                    <li class="nav-item">
                        <a id="log" class="nav-link" href="{% url 'repo:log' %}">
                            <span data-feather="file-minus"></span>
                            日志
                        </a>
                    </li>
                </ul>
            </div>
        </nav>

        <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
            {% block main %}
            {% endblock %}
        </main>
    </div>
</div>

<script src="{% static 'repo/bootstrap/js/bootstrap.bundle.min.js' %}"></script>
<script src="{% static 'repo/jquery/jquery-3.6.0.js' %}"></script>
<script src="{% static 'repo/m/mjs/util.js' %}"></script>
<script src="{% static 'repo/m/mjs/rgbcolor.js' %}"></script>

<script>
    (function () {
        let curPage
        {% block set_curPage %}
        {% endblock %}
        curPage.setAttribute("class", "nav-link active text-light")
        curPage.setAttribute("style", "background-color: #487eb0")
        curPage.setAttribute("aria-current", "page")
    })()
</script>

<script src="{% static 'repo/m/mjs/chart.js' %}"></script>
<script src="{% static 'repo/m/mjs/feather.js' %}"></script>

{% block javascript %}
{% endblock %}
<script>
    feather.replace({'aria-hidden': 'true'})
</script>
</body>
</html>
